package com.vaadin.terminal.gwt.server;

import javax.servlet.ServletException;
import org.codehaus.groovy.grails.commons.ApplicationHolder;
import org.codehaus.groovy.grails.commons.GrailsApplication;

/**
 *
 * @author Daniel Bell
 */
@SuppressWarnings("serial")
public class GrailsAwareApplicationServlet extends ApplicationServlet{

    /**
     * Returns the Grails ClassLoader, because the servlet's ClassLoader
     * can't see the Grails application source.
     * 
     * @return the ClassLoader stored in the {@link GrailsApplication}
     * @throws ServletException
     */
    @Override
    protected ClassLoader getClassLoader() throws ServletException {
        return ApplicationHolder.getApplication().getClassLoader();
    }

}
